
***************************************************************
This replication package is prepared for "Policy Experimentation in China: The Political Economy of Policy Learning (JPE, 2024)". Last edit: Jul 10, 2024.

If you have any questions, please direct them to David Yang (davidyyang@fas.harvard.edu); Shaoda Wang (shaoda@uchicago.edu); or Kaicheng Luo (kluo0630@mit.edu)

************************ Configuration ************************
For STATA do files, simply run master.do;
For python files, first edit CONFIG.py to reflect your working directory;
For R files, you need to edit the directories manually. (There are only 3 Rmd files)

(Note: For non-Mac users, you may need to edit each line of import directories manually.)

************************ Packages ************************
STATA:
ssc install binscatter
ssc install texsave
ssc install event_plot
ssc install egenmore
ssc install eventstudyinteract
ssc install avar
ssc install did_imputation
ssc install rdrobust
cap ado uninstall ftools
cap ado uninstall reghdfe
cap ado uninstall ivreghdfe
net install ftools, from(~/code/packages/stata_packages/ftools-2.49.1)
net install reghdfe, from(~/code/packages/stata_packages/reghdfe-6.12.4)
net install ivreghdfe, from(~/code/packages/stata_packages/ivreghdfe-1.1.2)
ssc install outreg2

R:
install.packages("devtools")		
install.packages("mapchina")		
install.packages("tidyverse")		
install.packages("sf")		
install.packages("dplyr")		
install.packages("~/R_packages/rgdal_1.6-7.tgz", repos = NULL, type = "binary")		
install.packages("~/R_packages/maptools_1.1-8.tgz", repos = NULL, type = "binary")		
install.packages("~/R_packages/rgeos_0.6-4.tgz", repos = NULL, type = "binary")

Python:
pip install paddlehub
pip install pandas==1.5.2
pip install paddlepaddle 
conda install -c conda-forge seaborn=0.12.2
pip install numpy
pip install pdb
pip install scikit-learn
pip install matplotlib
pip install scipy
pip install statsmodels
pip install cvxpy
pip install docplex

Julia:
"Pkg.add(""Debugger""); Pkg.add(""CSV""); Pkg.add(""DataFrames""); Pkg.add(""StatsBase"")
Pkg.add(""HypothesisTests""); Pkg.add(""JuMP""); Pkg.add(""GLPK"")"	

************************ Main exhibits ************************
Figures:
	Figure 1: F1F3A_descriptive.ipynb
	Figure 2: F2_map-bous2.Rmd
	Figure 3: F1F3A_descriptive.ipynb (Panel A) 
		  F3B_policy_construction_curve.ipynb (Panel B)
	Figure 4: F4_rollout_prediction.do
	Figure 5: F5_continuous_weights_county.ipynb

Tables: 
	Table 1: T1_descriptive.do
	Table 2: T2_endogenous_efforts.do (both panels)
	Table 3: T3A_land_revenue.do (Panel A) T3B_rotation.do (Panel B)
	Table 4: T4_m_distance.do

************************ Online appendix ************************
Figures: 
	Figure A1, County-level map of experimentation: AF1_county_mapchina.Rmd
	Figure A2-A8, Time-series of key characteristics:  AF2-8_additional_descriptive.ipynb
	Figure A9, t-test across sectors: AF9_ttest_robustness.ipynb
	Figure A10, panel ABCDE, t-test robustness: AF9_ttest_robustness.ipynb
		   panel FGH: AF10_weighted_tests.ipynb panel I: AF10I_migration.ipynb
	Figure A11, Permutation tests: AF11_permutation_tests.ipynb
	Figure A12, Fiscal allocation event study: fiscal_adjustments.do
	Figure A13, Land revenue IV unified regression: land_revenue_firststage.do
	Figure A14, Residualized shrinkage: AF14_deflator_resid.ipynb
	Figure A15, Weights on places and ATE deflation: AF15_continuous_weights.ipynb
	Figure A16, nightlight robustness: nightlight_analysis.do
	Figure A17, nightlight robustness: AF17_night_light.ipynb
	Figure A18, deflation of short-run policies: AF18_short_run_deflation.ipynb
	Figure A19, De-biasing via synthetic control: synth_debias.do
	Figure A20, t-test, fiscal empowerment: AF20_FRT_szgx.ipynb
	Figure A21-22, Event study for fiscal empowerment: county_reform_adjustment.do
	Figure A21, Simulated national effects: county_reform_analysis.do
	Figure A24, Tail effects: AF24_minimize_loss.ipynb
	Figure A25, Connection event study: connection_exp.do
	Figure A26, Author's production
	Figure A27, Author's production
	Figure A28, M-U event study: MU analysis.do
	Figure A29, Age and experimentation engagement: age-threshold.do
	Figure A30-33, Banerjee & Narita simulation: Simulation/make_graph.R
	Figure A34, Random sampling t-test robustness: AF34_random_sampling.ipynb
	Figure A35, Example, text analysis: AF35_text_similarity.ipynb

Tables:
	Table A1, Author's production
	Table A2, Author's production
	Table A3, Complexity, certainty and admin-level: complexity_certainty.do
	Table A4, Positive selection time trend: by_ministry_baseline.do
	Table A5, Experimentation and promotion: rollout_promotion.do
	Table A6, Alternative career incentive robustness: 58_effort.do
	Table A7, Small-scale allocation: small_scale.do
	Table A8, Fiscal allocation, economics of scale: second_order.do
	Table A9, Fiscal heterogeneity (GDP, GDPpc): fiscal analysis_het.do
	Table A10, Fiscal heterogeneity, others: fiscal analysis_het.do
	Table A11, Policy-by-county level fiscal analysis: policycounty.do
	Table A12, Long-term effects: post_experiment.do
	Table A13, Text similarity: text_similarity.do
	Table A14, Land revenue first stage: T3A_land_revenue.do
	Table A15, cross-section robustness: land_revenue_cross_section.do (Panel A)
		   poli_rotation_panel.do (Panel B)
	Table A16, Heterogeneity for land revenue, land_revenue_small_scale.do
	Table A17, Land revenue IV placebo: land_revenue_placebo.do
	Table A18, Rotation, robustness: poli_rotation_more.do
	Table A19, Rotation, more robustness: poli_rotation_more.do
	Table A20, Predict rollout (Table version): rollout_prediction_tables.do
	Table A21, Winsorized results: rollout_prediction_robustness
	Table A22, M-distance robustness: T4_m_distance.do
	Table A23, Connection and experimentation: connection_exp.do
	Table A24, Unrest and experimentation participation: unrest_exp.do
	Table A25, Unrest and rollout: protest_main.do
	Table A26, Author's production
	Table A27, Incentive and experimentation participation: incentive_exp.do
	Table A28, Incentive placebo: incentive_exp.do
	Table A29, Incentive first stage: incentive_first_stage.do
	Table A30, Accounting exercise: accounting_selection.do
	Table A31, Endogenous efforts, aggregating domains: T2_endogenous_efforts.do

************************ Raw data ************************
(Policy-experimentation-related, compiled by authors)
	Master dataset (policy.xlsx), a policy-level master data with all the attributes we used to describe policy experimentations.

(Auxiliary datasets)
	Admin data (county_data_93_18.dta, City Data Final.xlsx, prov_data_revised.dta): socio-economic indicators. Src: Government Yearbooks
	Politician data for prefectural leaders (career_incentive.dta): Src: Sun and Zhou (2020)
	Shape files (bou2_4p.shp, etc.)
	Fiscal data 93-06 (fiscal_9306_policy_merged_long.dta): Src: County Finance Statistics Yearbooks (1993-2006)
	Protests (protest_main.xlsx, protest_iv.xlsx): Src: GDELT Website
	Land value (land_revenue_exp.dta, unsuitability30.dta): Src: Chen and Kung (2016)
	Night light luminosity (county_year_nightlight.csv): Src: Raw image from NOAA website.
